﻿using System.Threading;
using System.Threading.Tasks;
using ATS.Dto;

namespace ATSSDK;

/// <summary>
/// ATS平台客户端接口。
/// </summary>
public interface IATSClient
{
     #region Product

    /// <summary>
    /// 创建产品
    /// </summary>
    ValueTask<ProductItemDto> CreateProductAsync(ProductCreateInput input, CancellationToken cancellation = default);

    /// <summary>
    /// 根据物料编码获取产品信息
    /// </summary>
    /// <param name="materialCode">物料编码</param>
    /// <param name="cancellation"></param>
    /// <returns></returns>
    ValueTask<ProductItemDto?> GetProductByCodeAsync(string materialCode, CancellationToken cancellation = default);

    /// <summary>
    /// 根据产品ID获取产品信息
    /// </summary>
    /// <param name="id">产品ID</param>
    /// <param name="cancellation"></param>
    /// <returns></returns>
    ValueTask<ProductItemDto?> GetProductByIdAsync(string id, CancellationToken cancellation = default);

    #endregion

    #region TestManufacturing

    /// <summary>
    /// 创建生产工艺
    /// </summary>
    /// <param name="input"></param>
    /// <param name="requestAborted"></param>
    /// <returns></returns>
    ValueTask<TestManufacturingItemDto> CreateManufacturingAsync(TestManufacturingCreateInput input, CancellationToken cancellation = default);


    /// <summary>
    /// 创建生产工艺
    /// </summary>
    /// <param name="input"></param>
    /// <param name="requestAborted"></param>
    /// <returns></returns>
    ValueTask ChangeManufacturingStatusAsync(TestManufacturingChangeStatusInput input, CancellationToken cancellation = default);

    /// <summary>
    /// 根据ID获取生产工艺信息
    /// </summary>
    /// <param name="id">生成工艺ID</param>
    /// <returns></returns>
    ValueTask<TestManufacturingItemDto?> GetTestManufacturingByIdAsync(string id, CancellationToken cancellation = default);

    /// <summary>
    /// 根据外部编码获取生产工艺信息
    /// </summary>
    /// <param name="code">外部编码</param>
    ValueTask<TestManufacturingItemDto?> GetTestManufacturingByCodeAsync(string code, CancellationToken cancellation = default);

    #endregion
}
